<?php echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; ?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
>
<channel>
	<atom:link href="<?php echo $this->url('home');?>/feed" rel="self" type="application/rss+xml" />
	<title><?php echo $this->setting->blogname; ?></title>
	<link><?php echo $this->url('home');?>/</link>
	<description><?php echo $this->setting->blogdescription; ?></description>
	<lastBuildDate><?php echo date('r', time()); ?></lastBuildDate>
	<generator><?php echo $this->setting->home; ?>/</generator>
	<image>
		<title><?php echo $this->setting->blogname; ?></title>
		<link><?php echo $this->url('home');?>/</link>
		<url><?php echo $this->setting->static; ?>/img/logo.png</url>
		<width>138</width>
		<height>36</height>
	</image>
	<?php foreach($posts->Data AS $key => $post) { ?>
	<?php $author = $this->cache->get_author_detail($post->author); ?>
	<item>
		<title><?php echo $post->title; ?></title>
		<link><?php echo $this->url('post', $post->ID); ?></link>
		<comments><?php echo $this->url('post', $post->ID); ?>#comment</comments>
		<pubDate><?php echo date('r',$post->time); ?></pubDate>
		<author><?php echo $author->display_name; ?></author>
		<?php foreach((array)$this->cache->get_term_by_id($post->ID, 'category') as $category) { ?>
		<category><![CDATA[<?php echo $category->name; ?>]]></category>
		<?php } ?>
		<?php foreach((array)$this->cache->get_term_by_id($post->ID, 'post_tag') as $tag) { ?>
		<category><![CDATA[<?php echo $tag->name; ?>]]></category>
		<?php } ?>
		<description><![CDATA[<?php
		if($post->password=='' || $this->check_post_password($post->ID)) {
			echo $this->htmlSubString($post->content, 480);
		} else {
			echo "<p>这是一篇受密码保护的文章。您需要提供访问密码。</p>";
		}
		?>]]></description>
		<comments><?php echo $this->url('post', $post->ID); ?>/feed</comments>		
	</item>
	<?php } ?>
</channel>
</rss>
